package com.fadis.expire;

public class ExpireInfo {

    public long touchTime;
    public long lifeTime;

    private ExpireInfo() {
    }

    public static ExpireInfo create(long lifeTime){
        ExpireInfo e = new ExpireInfo();
        e.touchTime = System.currentTimeMillis();
        e.lifeTime = lifeTime;
        return e;
    }

    public void touch(){
        touchTime = System.currentTimeMillis();
    }

    public boolean isExpired(){
        return System.currentTimeMillis() - touchTime > lifeTime;
    }


}
